package cn.itsy.service.ductype;

import cn.itsy.dao.ductype.DucTypeDao;
import cn.itsy.pojo.Duct;
import cn.itsy.pojo.Ductype;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @author: MisterGay
 * @date: 2019-05-30 14:08
 */
@Service(value = "ducTypeServiceimpl")
public class DucTypeServiceimpl implements DucTypeService {
    @Resource(name = "ducTypeDaoimpl")
    private DucTypeDao ducTypeDao;

    @Override
    public List<Ductype> queryDucTypeAll(String sql) {
        List<Ductype> ductypes = this.ducTypeDao.queryDucTypeAll(sql);
        return ductypes;
    }

    @Override
    public boolean insertDucType(String sql, Ductype ductype) {
        Integer integer = this.ducTypeDao.insertDucType(sql, ductype);
        if (integer != 0) {
            return true;
        }
        return false;
    }

    @Override
    public List<Duct> queryDuctById(String sql, Ductype ductype) {
        List<Duct> ducts = this.ducTypeDao.queryDuctById(sql, ductype);
        return ducts;
    }

    @Override
    public Integer deleteDuctypeById(String sql, Ductype ductype) {
        Integer integer = this.ducTypeDao.deleteDuctypeById(sql, ductype);
        return integer;
    }

    @Override
    public Integer updateDuctNameById(String sql, Ductype ductype) {
        this.ducTypeDao.updateDuctNameById(sql, ductype);
        return null;
    }
}
